package com.ruoyi.project.jiaqin.companyautograph.service.impl;

import java.util.List;
import java.util.UUID;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.project.jiaqin.companyautograph.mapper.CompanyAutographMapper;
import com.ruoyi.project.jiaqin.companyautograph.domain.CompanyAutograph;
import com.ruoyi.project.jiaqin.companyautograph.service.ICompanyAutographService;
import com.ruoyi.common.utils.text.Convert;

/**
 * 企业个性签名Service业务层处理
 *
 * @author admin
 * @date 2021-02-19
 */
@Service
public class CompanyAutographServiceImpl implements ICompanyAutographService
{
    @Autowired
    private CompanyAutographMapper companyAutographMapper;

    /**
     * 查询企业个性签名
     *
     * @param id 企业个性签名ID
     * @return 企业个性签名
     */
    @Override
    public CompanyAutograph selectCompanyAutographById(String id)
    {
        return companyAutographMapper.selectCompanyAutographById(id);
    }

    /**
     * 查询企业个性签名列表
     *
     * @param companyAutograph 企业个性签名
     * @return 企业个性签名
     */
    @Override
    public List<CompanyAutograph> selectCompanyAutographList(CompanyAutograph companyAutograph)
    {
        return companyAutographMapper.selectCompanyAutographList(companyAutograph);
    }

    /**
     * 新增企业个性签名
     *
     * @param companyAutograph 企业个性签名
     * @return 结果
     */
    @Override
    public int insertCompanyAutograph(CompanyAutograph companyAutograph)
    {
        companyAutograph.setId(UUID.randomUUID().toString().replace("-",""));
        return companyAutographMapper.insertCompanyAutograph(companyAutograph);
    }

    /**
     * 修改企业个性签名
     *
     * @param companyAutograph 企业个性签名
     * @return 结果
     */
    @Override
    public int updateCompanyAutograph(CompanyAutograph companyAutograph)
    {
        return companyAutographMapper.updateCompanyAutograph(companyAutograph);
    }

    /**
     * 删除企业个性签名对象
     *
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteCompanyAutographByIds(String ids)
    {
        return companyAutographMapper.deleteCompanyAutographByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除企业个性签名信息
     *
     * @param id 企业个性签名ID
     * @return 结果
     */
    @Override
    public int deleteCompanyAutographById(String id)
    {
        return companyAutographMapper.deleteCompanyAutographById(id);
    }
}
